﻿<Window x:Class="SoftTeach.View.Stundenpläne.AddStundenplaneintragDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:softTeach="clr-namespace:SoftTeach"
        xmlns:controls="clr-namespace:SoftTeach.Resources.Controls"
        xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" 
        Title="Stundenplaneintrag ..." 
        Height="297" 
        Width="352" 
        ResizeMode="NoResize" 
        WindowStyle="SingleBorderWindow"
        Background="{x:Static SystemColors.MenuBarBrush}">
  <Window.Resources>
    <CollectionViewSource Source="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Klassen}" x:Key="KlassenSorted">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="KlasseBezeichnung" Direction="Ascending"/>
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
    <CollectionViewSource Source="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Fächer}" x:Key="FächerSorted">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="FachBezeichnung" Direction="Ascending"/>
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
    <CollectionViewSource Source="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Räume}" x:Key="RäumeSorted">
      <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="RaumBezeichnung" Direction="Ascending"/>
      </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
  </Window.Resources>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <controls:SmallDialogHeader Grid.Row="0" Title="Neuen Stundenplaneintrag für diese Lerngruppe anlegen..."
                                      Icon="/SoftTeach;component/Images/Stundenplan32.png"/>
    <Grid Grid.Row="1" Margin="10">
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" TextWrapping="Wrap">Bitte geben Sie Fach, Lerngruppe und Raum an.</TextBlock>
      <Label Grid.Row="1" Grid.Column="0" VerticalContentAlignment="Center">Fach</Label>
      <ComboBox Margin="3" Grid.Row="1" Grid.Column="1" TabIndex="1"
                ItemsSource="{Binding Source={StaticResource FächerSorted}}" 
                SelectedItem="{Binding Path=StundenplaneintragFach}"
                DisplayMemberPath="FachBezeichnung"
                Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}" Width="230"/>
      <Label Grid.Row="2" Grid.Column="0" VerticalContentAlignment="Center">Lerngruppe</Label>
      <ComboBox Margin="3" Grid.Row="2" Grid.Column="1" TabIndex="2"
                ItemsSource="{Binding Source={StaticResource KlassenSorted}}" 
                SelectedItem="{Binding Path=StundenplaneintragKlasse}"
                DisplayMemberPath="KlasseBezeichnung"
                Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}" Width="230"/>
      <Label Grid.Row="3" Grid.Column="0" VerticalContentAlignment="Center">Raum</Label>
      <ComboBox Margin="3" Grid.Row="3" Grid.Column="1" TabIndex="2"
                ItemsSource="{Binding Source={StaticResource RäumeSorted}}" 
                SelectedItem="{Binding Path=StundenplaneintragRaum}"
                DisplayMemberPath="RaumBezeichnung"
                Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}" Width="230"/>

      <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal" Margin="0,5" Width="230">
        <Label VerticalContentAlignment="Center" >Von</Label>
        <Label VerticalContentAlignment="Center" Margin="3" Content="{Binding Path=StundenplaneintragErsteUnterrichtsstundeIndex}"/>
        <Label VerticalContentAlignment="Center" >bis</Label>
        <Label VerticalContentAlignment="Center" Margin="3" Content="{Binding Path=StundenplaneintragLetzteUnterrichtsstundeIndex}"/>
        <Label VerticalContentAlignment="Center" >Stunde</Label>
      </StackPanel>
    </Grid>
    <Grid Background="{StaticResource DefaultButtonsBackgroundBrush}" Grid.Row="2">
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10">
        <Button Width="100" HorizontalAlignment="Right" IsDefault="True" Click="OkClick" TabIndex="2">OK</Button>
        <Label></Label>
        <Button Width="100" HorizontalAlignment="Right" IsDefault="True" Click="CancelClick">Abbrechen</Button>
      </StackPanel>
    </Grid>
  </Grid>
</Window>
